Skip to content

Bump numpy to <2.6.0 - #4111

Open
AlexanderDokuchaev wants to merge 6 commits into
openvinotoolkit:developfrom
AlexanderDokuchaev:ad/numpy25
Open

AlexanderDokuchaev wants to merge 6 commits into
openvinotoolkit:developfrom
AlexanderDokuchaev:ad/numpy25

Conversation

@AlexanderDokuchaev

@AlexanderDokuchaev AlexanderDokuchaev commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Changes

Set numpy>=1.24.0, <2.6.0 for requarements
Replaced NDArray to np.ndarray[Any, np.dtype[Any]]

Reason for changes

New release of numpy

Related tickets

Tests

https://github.com/openvinotoolkit/nncf/actions/runs/35595737581

@AlexanderDokuchaev AlexanderDokuchaev changed the title Update numpy to <2.6.0 Bump numpy to <2.6.0 Jun 22, 2026
@AlexanderDokuchaev
AlexanderDokuchaev marked this pull request as ready for review September 21, 2026 12:18
@AlexanderDokuchaev
AlexanderDokuchaev requested a review from a team as a code owner September 21, 2026 12:18
Copilot AI lite review requested due to automatic review settings September 21, 2026 12:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The NumPy backend searchsorted return type annotation is incorrect and contradicts the documented dispatcher contract, which can mislead API consumers and type checking.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

This PR updates NNCF’s NumPy compatibility by raising the upper bound to <2.6.0 and adjusting array type annotations/usages across tensor backends to align with newer NumPy typing/stubs.

Changes:

  • Bumped NumPy dependency constraint to <2.6.0.
  • Replaced numpy.typing.NDArray with np.ndarray[...]-based annotations in multiple tensor backends.
  • Added/adjusted a few typing suppressions to satisfy stricter type checking with newer NumPy stubs.
File Description
src/​nncf/​tensor/​functions/​torch_numeric.py Updates NumPy array type annotations and removes an obsolete typing ignore around masked median.
src/​nncf/​tensor/​functions/​openvino_numeric.py Adds NumPy import and updates NumPy array type annotations for OpenVINO conversions.
src/​nncf/​tensor/​functions/​numpy_numeric.py Updates core NumPy backend array typing and adds typing ignores for stricter overloads; adjusts searchsorted typing.
src/​nncf/​tensor/​functions/​numpy_linalg.py Updates NumPy array type alias away from NDArray.
src/​nncf/​tensor/​functions/​numpy_io.py Updates NumPy array type alias away from NDArray.
src/​nncf/​quantization/​algorithms/​weight_compression/​constants.py Adds a typing suppression for slicing-derived quantile centers.
pyproject.toml Bumps NumPy upper version bound to <2.6.0.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/nncf/tensor/functions/numpy_numeric.py

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants